<?php
namespace app\admin\controller;
use think\Db;

class Notice extends SessionCheck
{
    public function index()
    {
		$data = Db::table("notice")->select();
        return view('',['data'  => $data,'menu_list'=>$this->menu_list]);
    }
	
	public function edit()
    {
		$id = input("get.id")?input("get.id"):0;
		if(request()->isPost()){
			$data = input("post.");
			if($data['title'] == '关于我们'){
			    $data['content'] = strip_tags($data['content']);
            }
			Db::table("notice")->where(['id' => $id])->update($data);
		}
        $data = Db::table("notice")->where(['id' => $id])->find();
        return view('',['data'  => $data]);
    }

}
